<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>联合奖惩反馈</title>
    <style type="text/css">
        html, body {
            margin: 0px;
            padding: 0px;
            width: 100%;
            height: 100%;
            font-family: "微软雅黑";
        }

        .main {
            width: 1000px;
            margin: 20px auto;
            margin-top: 0px;
            border: 1px solid #ccc;
            font-size: 14px;
            padding-bottom: 30px;
            box-sizing: border-box;
        }

        .main1 li {
            list-style: none;
            float: left;
            width: 25%;
            height: 40px;
            line-height: 40px;
        }

        .main1 li:nth-of-type(2n + 1) {
            text-align: right;
        }

        .main1 li.width75 {
            width: 75%;
        }

        .main2 {
            clear: both;
        }

        .moduleTitle {
            padding-left: 20px;
            font-size: 16px;
        }

        .main table {
            width: 100%;
            text-align: center;
            border-collapse: collapse;
        }

        .main table th, .main table td {
            border: 1px solid #ccc;
            padding: 8px;
        }

        .main table tr td:nth-last-of-type, .main table tr th:nth-last-of-type {
            border-right: none;
        }

        .main table tr td:nth-of-type(1), .main table tr th:nth-of-type(1) {
            border-left: none;
        }

        .main4 textarea .main4 input {
            outline: none;
        }

        .main4 input {
            padding: 4px 8px;
        }

        .main4 textarea {
            width: 800px;
            height: 120px;
            vertical-align: text-top;
        }

        .main4 .input-item {
            margin-bottom: 20px;
        }

        .input-item label {
            width: 100px;
            display: inline-block;
            padding-left: 20px;
            text-align: right;
        }

        .colorRed {
            color: red;
        }

        .pull-rights {
            float: right;
            margin-right: 69px;
        }

        .pull-rights input {
            width: 360px;
        }

        .sbumin-item button {
            outline: none;
            cursor: pointer;
            padding: 8px 16px;
            border: 1px solid #aaa;
            background: #fff;
            border-radius: 5px;
        }

        .sbumin-item button:hover {
            background: #f1f1f1;
        }

        .sbumin-item button:nth-of-type(1) {
            margin-left: 120px;
        }

        .sbumin-item button:nth-of-type(2) {
            margin-left: 50px;
        }

        .switchBar {
            height: 40px;
            width: 1000px;
            margin: 0 auto;
            margin-top: 20px;
        }

        .switchBar div {
            height: 40px;
            line-height: 40px;
            float: left;
            padding: 0px 20px;
            border: 1px solid #ccc;
            box-sizing: border-box;
            border-bottom: none;
            cursor: pointer;
        }

        .switchBar div:nth-of-type(1) {
            border-right: none;
        }

        .switchBar div.active {
            background: #f1f1f1;
        }

        .mainlhjl {
            display: none;
        }

        span.nowrap {
            overflow: hidden;
            display: block;
            margin: 0 auto;
            text-overflow: ellipsis;
            white-space: nowrap;
            word-wrap: normal;
        }
    </style>
    <script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript">
        var ctx = '${base}';
    </script>
</head>
<body>
<div class="switchBar">
    <div class="active">联合惩戒</div>
    <div>联合激励</div>
</div>
<input type="hidden" id="qyid" value="${qyid}">
<input type="hidden" id="username" value="${username}">
<div class="main mainlhjc">
    <div class="main1">
        <li>企业名称：</li>
        <li class="width75" id="cjqymc">${qymc}</li>
        <li>统一社会信用代码：</li>
        <li id="cjtyshxydm">${tyshxydm}</li>
        <li>组织机构代码：</li>
        <li id="cjzjgdm">${zjgdm}</li>
        <li>工商登记号：</li>
        <li id="cjgsdjm">${gsdjm}</li>
        <li>税务登记号：</li>
        <li id="cjswdjh">${swdjh}</li>
    </div>
    <div class="main2">
        <h3 class="moduleTitle">黑名单：</h3>
        <table>
            <thead>
            <tr>
                <th>序号</th>
                <th>黑名单</th>
                <th>发起部门</th>
                <th>发布时间</th>
            </tr>
            </thead>
            <tbody>
            <#list heimdGzList as heimdGz>
            <tr>
                <td><span class="nowrap" style="width: 70px;">${heimdGz_index+1}</span></td>
                <td><span name="heimdGzList" class="nowrap" style="width: 320px;"
                          title="${heimdGz.name}">${heimdGz.name}</span></td>
                <td><span class="nowrap" style="width: 320px;">${heimdGz.dept_name}</span></td>
                <td><span class="nowrap" style="width: 150px;">${heimdGz.creditTime}</span></td>
            </tr>
            </#list>
            </tbody>
        </table>
    </div>
    <div class="main3">
        <h3 class="moduleTitle">联合惩戒措施：</h3>
        <table>
            <thead>
            <tr>
                <th><input class="lhcj-list-all" type="checkbox" name="" id="" value=""/></th>
                <th>序号</th>
                <th>惩戒措施</th>
            </tr>
            </thead>
            <tbody>
            <#list heimdCsList as heimdCs>
            <tr>
                <td><span class="nowrap" style="width: 230px;"><input class="lhcj-list" type="checkbox"
                                                                      name="heimdCsList" id="" value="${heimdCs.ajbh}"/></span>
                </td>
                <td><span class="nowrap" style="width: 240px;">${heimdCs_index+1}</span></td>
                <td><span class="nowrap" style="width: 470px;" title="${heimdCs.remark}">${heimdCs.remark}</span></td>
            </tr>
            </#list>
            </tbody>
        </table>
    </div>
    <div class="main4">
        <h3 class="moduleTitle">联合惩戒内容：</h3>
        <div class="input-item">
            <label for="">业务事项：</label>
            <textarea id="cjywsx" name="" rows="" cols=""></textarea>
        </div>
        <div class="input-item">
            <label for=""><span class="colorRed">*</span>惩戒内容：</label>
            <textarea id="cjnr" name="" rows="" cols=""></textarea>
        </div>
        <div class="input-item">
            <label for=""><span class="colorRed">*</span>涉及金额：</label>
            <input type="number" name="" id="cjje" value=""/> <span>元</span>
        </div>
        <div class="input-item">
            <label for="">惩戒成效：</label>
            <textarea id="cjcx" name="" rows="" cols=""></textarea>
        </div>
        <div class="input-item">
            <label for="">备注：</label>
            <textarea id="cjbz" name="" rows="" cols=""></textarea>
        </div>
        <div class="input-item">
            <label for="">执行时间：</label>
            <input type="date" name="" id="cjsj" value=""/>
            <div class="pull-rights">
                <label for="">执行部门：</label>
                <input type="" name="" id="cjbm" value=""/>
            </div>
        </div>
        <div class="sbumin-item">
            <button onclick="feedbackClose()">暂不惩戒</button>
            <div class="pull-rights">
                <button onclick="cjFeedback()">确认</button>
                <button onclick="feedbackClose()">取消</button>
            </div>
        </div>
    </div>
</div><!--联合奖励-->
<div class="main mainlhjl">
    <div class="main1">
        <li>企业名称：</li>
        <li id="jlqymc" class="width75">${qymc}</li>
        <li>统一社会信用代码：</li>
        <li id="jltyshxydm">${tyshxydm}</li>
        <li>组织机构代码：</li>
        <li id="jlzjgdm">${zjgdm}</li>
        <li>工商登记号：</li>
        <li id="jlgsdjm">${gsdjm}</li>
        <li>税务登记号：</li>
        <li id="jlswdjh">${swdjh}</li>
    </div>
    <div class="main2">
        <h3 class="moduleTitle">红名单：</h3>
        <table>
            <thead>
            <tr>
                <th>序号</th>
                <th>红名单</th>
                <th>发起部门</th>
                <th>发布时间</th>
            </tr>
            </thead>
            <tbody>
            <#list hongmdGzList as hongmdGz>
            <tr>
                <td><span class="nowrap" style="width: 70px;">${hongmdGz_index+1}</span></td>
                <td><span name="hongGzList" class="nowrap" style="width: 320px;"
                          title="${hongmdGz.name}">${hongmdGz.name}</span></td>
                <td><span class="nowrap" style="width: 320px;">${hongmdGz.dept_name}</span></td>
                <td><span class="nowrap" style="width: 150px;">${hongmdGz.creditTime}</span></td>
            </tr>
            </#list>
            </tbody>
        </table>
    </div>
    <div class="main3">
        <h3 class="moduleTitle">联合激励措施：</h3>
        <table>
            <thead>
            <tr>
                <th><input class="lhjl-list-all" type="checkbox" name="" id="" value=""/></th>
                <th>序号</th>
                <th>激励措施</th>
            </tr>
            </thead>
            <tbody>
            <#list hongmdCsList as hongmdCs>
            <tr>
                <td><span class="nowrap" style="width: 230px;"><input class="lhjl-list" type="checkbox"
                                                                      name="hongmdCsList" id=""
                                                                      value="${hongmdCs.ajbh}"/></span></td>
                <td><span class="nowrap" style="width: 240px;">${hongmdCs_index+1}</span></td>
                <td><span class="nowrap" style="width: 470px;" title="${hongmdCs.remark}">${hongmdCs.remark}</span></td>
            </tr>
            </#list>
            </tbody>
        </table>
    </div>
    <div class="main4">
        <h3 class="moduleTitle">联合激励内容：</h3>
        <div class="input-item">
            <label for="">业务事项：</label>
            <textarea id="jlywsx" name="" rows="" cols=""></textarea>
        </div>
        <div class="input-item">
            <label for=""><span class="colorRed">*</span>激励内容：</label>
            <textarea id="jlnr" name="" rows="" cols=""></textarea>
        </div>
        <div class="input-item">
            <label for=""><span class="colorRed">*</span>涉及金额：</label>
            <input type="number" name="" id="jlje" value=""/> <span>元</span>
        </div>
        <div class="input-item">
            <label for="">激励成效：</label>
            <textarea id="jlcx" name="" rows="" cols=""></textarea>
        </div>
        <div class="input-item">
            <label for="">备注：</label>
            <textarea id="jlbz" name="" rows="" cols=""></textarea>
        </div>
        <div class="input-item">
            <label for="">执行时间：</label>
            <input type="date" name="" id="jlsj" value=""/>
            <div class="pull-rights">
                <label for="">执行部门：</label>
                <input type="" name="" id="jlbm" value=""/>
            </div>
        </div>
        <div class="sbumin-item">
            <button onclick="feedbackClose()">暂不激励</button>
            <div class="pull-rights">
                <button onclick="jlFeedback()">确认</button>
                <button onclick="feedbackClose()">取消</button>
            </div>
        </div>
    </div>
</div>

</body>
<script type="text/javascript">
    var switchBarEle = document.querySelectorAll('.switchBar div');
    switchBarEle[0].onclick = function () {
        switchBarEle[0].className = 'active';
        switchBarEle[1].className = '';
        document.getElementsByClassName('mainlhjc')[0].style.display = 'block';
        document.getElementsByClassName('mainlhjl')[0].style.display = 'none';
    }
    switchBarEle[1].onclick = function () {
        switchBarEle[0].className = '';
        switchBarEle[1].className = 'active';
        document.getElementsByClassName('mainlhjc')[0].style.display = 'none';
        document.getElementsByClassName('mainlhjl')[0].style.display = 'block';
    }
    var lhjlListAll = document.querySelector('.lhjl-list-all');
    var lhjlList = document.querySelectorAll('.lhjl-list');
    lhjlListAll.onclick = function () {
        for (var i = 0; i < lhjlList.length; i++) {
            lhjlList[i].checked = lhjlListAll.checked;
        }
    }
    var lhcjListAll = document.querySelector('.lhcj-list-all');
    var lhcjList = document.querySelectorAll('.lhcj-list');
    lhcjListAll.onclick = function () {
        for (var i = 0; i < lhcjList.length; i++) {
            lhcjList[i].checked = lhcjListAll.checked;
        }
    }

    function cjFeedback() {
        var id = document.getElementById("qyid").value;
        var username = document.getElementById("username").value;
        var objname = document.getElementById("cjqymc").innerText;
        var objtype = "1";
        var creditcode = document.getElementById("cjtyshxydm").innerText;
        var executedt = document.getElementById("cjsj").value;
        var executeunit = document.getElementById("cjbm").value;
        var accordingto = "";
        var measurename = "";
        var matter = document.getElementById("cjywsx").value;
        var content = document.getElementById("cjnr").value;
        var money = document.getElementById("cjje").value;
        var backtype = "1";
        var result = document.getElementById("cjcx").value;
        var remark = document.getElementById("cjbz").value;

        if ($("input[name='heimdCsList']:checked").length == 0) {
            alert("惩戒措施未选择");
            return;
        }

        var csArr = document.getElementsByName("heimdCsList");

        for (var i = 0; i < csArr.length; i++) {
            if (csArr[i].checked) {
                measurename = measurename + csArr[i].value + "_";
            }
        }
        measurename = measurename.substr(0, measurename.length - 1);

        if (executedt == "") {
            alert("惩戒执行时间必填");
            return;
        }

        if (executeunit == "") {
            alert("惩戒执行部门必填");
            return;
        }

        if (content == "") {
            alert("惩戒内容必填");
            return;
        }

        if (money == "") {
            money = "0";
        }

        var gzArr = document.getElementsByName("heimdGzList");
        for (var i = 0; i < gzArr.length; i++) {
            accordingto = accordingto + gzArr[i].innerText + ",";
        }
        accordingto = accordingto.substr(0, accordingto.length - 1);

        var param = {
            "id": id,
            "username": username,
            "objname": objname,
            "objtype": objtype,
            "creditcode": creditcode,
            "executedt": executedt,
            "executeunit": executeunit,
            "accordingto": accordingto,
            "measurename": measurename,
            "matter": matter,
            "content": content,
            "money": money,
            "backtype": backtype,
            "result": result,
            "remark": remark
        };

        $.ajax({
            url: ctx + "/subjectCenter/feedback.json",
            type: "POST",
            data: param,
            dataType: "json",
            success: function (data) {
                alert(data.msg);
            }
        });
    }

    function jlFeedback() {
        var id = document.getElementById("qyid").value;
        var username = document.getElementById("username").value;
        var objname = document.getElementById("jlqymc").innerText;
        var objtype = "1";
        var creditcode = document.getElementById("jltyshxydm").innerText;
        var executedt = document.getElementById("jlsj").value;
        var executeunit = document.getElementById("jlbm").value;
        var accordingto = "";
        var measurename = "";
        var matter = document.getElementById("jlywsx").value;
        var content = document.getElementById("jlnr").value;
        var money = document.getElementById("jlje").value;
        var backtype = "2";
        var result = document.getElementById("jlcx").value;
        var remark = document.getElementById("jlbz").value;

        if ($("input[name='hongmdCsList']:checked").length == 0) {
            alert("激励措施未选择");
            return;
        }

        var csArr = document.getElementsByName("hongmdCsList");

        for (var i = 0; i < csArr.length; i++) {
            if (csArr[i].checked) {
                measurename = measurename + csArr[i].value + "_";
            }
        }
        measurename = measurename.substr(0, measurename.length - 1);

        if (executedt == "") {
            alert("激励执行时间必填");
            return;
        }

        if (executeunit == "") {
            alert("激励执行部门必填");
            return;
        }

        if (content == "") {
            alert("激励内容必填");
            return;
        }

        if (money == "") {
            money = "0";
        }

        var gzArr = document.getElementsByName("hongmdGzList");
        for (var i = 0; i < gzArr.length; i++) {
            accordingto = accordingto + gzArr[i].innerText + ",";
        }
        accordingto = accordingto.substr(0, accordingto.length - 1);

        var param = {
            "id": id,
            "username": username,
            "objname": objname,
            "objtype": objtype,
            "creditcode": creditcode,
            "executedt": executedt,
            "executeunit": executeunit,
            "accordingto": accordingto,
            "measurename": measurename,
            "matter": matter,
            "content": content,
            "money": money,
            "backtype": backtype,
            "result": result,
            "remark": remark
        };

        $.ajax({
            url: ctx + "/subjectCenter/feedback.json",
            type: "POST",
            data: param,
            dataType: "json",
            success: function (data) {
                alert(data.msg);
            }
        });
    }

    function feedbackClose() {
        window.close();
    }
</script>
</html>
